#include "CTabBar.h"
#include <QtWidgets/private/qtabbar_p.h>

CTabBar::CTabBar(QWidget *parent) : QTabBar(parent) {
}

CTabBar::~CTabBar() {
}

int CTabBar::previousIndex() const {
    auto d = static_cast<QTabBarPrivate *>(d_ptr.data());
    int index = d->currentIndex;
    if (index < 0 || index >= d->tabList.size()) {
        return -1;
    }
    return d->tabList[index].lastTab;
}
